package controller;

import java.sql.SQLException;
import java.util.ArrayList;

import model.Outsider;
import db.DBSupplier;
import db.IFSupplier;

public class SupplierController extends OutsiderController
{
	private static SupplierController instance = null;

	public static SupplierController getInstance()
	{
		if(instance == null)
			instance = new SupplierController();

		return instance;
	}
	
	public Outsider searchSupplierID(int supplierID) throws SQLException
	{
		IFSupplier dbSupplier = new DBSupplier();

		return dbSupplier.searchSupplierID(supplierID);
	}

	public Outsider searchSupplierByName(String name) throws SQLException
	{
		IFSupplier dbSupplier = new DBSupplier();

		return dbSupplier.searchSupplierByName(name);
	}

	public ArrayList<Outsider> searchSupplierEverything(boolean active,	String search) throws SQLException
	{
		IFSupplier dbSupplier = new DBSupplier();

		return dbSupplier.searchSupplierEverything(active, search);
	}

	public ArrayList<Outsider> searchSupplierName(boolean active, String search) throws SQLException
	{
		IFSupplier dbSupplier = new DBSupplier();

		return dbSupplier.searchSupplierName(active, search);
	}

	public ArrayList<Outsider> searchSupplierEmail(boolean active, String search) throws SQLException
	{
		IFSupplier dbSupplier = new DBSupplier();

		return dbSupplier.searchSupplierEmail(active, search);
	}

	public ArrayList<Outsider> searchSupplierPhoneNo(boolean active, String search) throws SQLException
	{
		IFSupplier dbSupplier = new DBSupplier();

		return dbSupplier.searchSupplierPhoneNo(active, search);
	}

	public ArrayList<Outsider> searchSupplierCity(boolean active, String search) throws SQLException
	{
		IFSupplier dbSupplier = new DBSupplier();

		return dbSupplier.searchSupplierCity(active, search);
	}

	public ArrayList<Outsider> searchSupplierCountry(boolean active, String search) throws SQLException
	{
		IFSupplier dbSupplier = new DBSupplier();

		return dbSupplier.searchSupplierCountry(active, search);
	}

	public ArrayList<Outsider> printAllSuppliers(int itemID) throws SQLException
	{
		IFSupplier dbSupplier = new DBSupplier();

		return dbSupplier.printAllSuppliers(itemID);
	}
}